home *** CD-ROM | disk | FTP | other *** search
- Path: rcp6.elan.af.mil!rscernix!danpop
- From: danpop@mail.cern.ch (Dan Pop)
- Newsgroups: comp.lang.c
- Subject: Re: Kind of an annoying question...
- Date: 12 Mar 96 12:32:03 GMT
- Organization: CERN European Lab for Particle Physics
- Message-ID: <danpop.826633923@rscernix>
- References: <4hvrio$c4k@lastactionhero.rs.itd.umich.edu> <4i1c48$2si@nuacht.iol.ie>
- NNTP-Posting-Host: ues5.cern.ch
- X-Newsreader: NN version 6.5.0 #7 (NOV)
-
- In <4i1c48$2si@nuacht.iol.ie> Roy Leonard <rleonard@ferrotec.ie> writes:
-
-
- >speng@stimpy.us.itd.umich.edu (Steve Palmer Peng) wrote:
- >>I'm wondering, just what function in C allows me to enter a character
- >>from the keyboard, and it automatically executes the command I designate
- >>that character to. For instance, I have something like,
- >>
- >>printf("Enter Y or N:");
- >>
- >>and I want the command after the printf statement to wait for input
- >>from the keyboard, but once someone enters a Y or an N, the next line of
- >>code is executed, without hitting enter. Does anyone know how? It would
- >>be greatly appreciated if someone could help me out here...
- >
- >Sounds like you are looking for getch [get single char]/getche [get
- >character and echo to the screen.]
-
- And the bad news are that neither getch nor getche are part of the
- C library. For more details, see the FAQ.
-
- Dan
- --
- Dan Pop
- CERN, CN Division
- Email: danpop@mail.cern.ch
- Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
-